Simple For Script

I just want to delete all entries in a column for a given attribute.  So I wrote this:

for <attribute> in current do
{obj=void}

And tried these:

1)     string delete(Module, AttrDef <attribute>)

2)     <attribute> = modify(<attribute>, setDefault, void)

Unfortunately, I'm somewhat new to DXL and can't seem to troubleshoot the faults or use the DXL help very well.  Additionally, I'd like to be able to highlight a group within a column and delete them, but that may be overly complicated.

 


stevenson - Mon Jul 08 11:45:24 EDT 2013

Re: Simple For Script
GregM_dxler - Mon Jul 08 15:37:52 EDT 2013

Might be worthwhile to get a class in dxl.

To delete all entries for an attribute "_CR number" you can try the following script:

Object o

string attr = "_CR number"

for o in current Module do {

   o.attr = null

}

Hope this helps,

Greg

Re: Simple For Script
Tony_Goodman - Fri Jul 12 06:24:54 EDT 2013

I am curious to know why you are attempting to do this using DXL.

This sort of operation is best done using the user interface.

Re: Simple For Script
ChrisAnnal - Fri Jul 12 10:53:15 EDT 2013

As Tony suggested, the best approach may be to simply use the built-in tools of DOORS, rather than writing a script in this case.

  • Right-click on an object
  • Select "Properties"
  • In the Properties dialog, select the "Attributes" tab
  • For the selected Attribute, use the "View/Edit" button to make the necessary change. In this case, you could use to select the default, which should remove any existing choice
  • Use the additional radio buttons for applying the change to just the Current object, Selected objects, or Objects in current view

You can use this method to make changes to a large number of objects at once. I hope this helps.